import request from "@/utils/request.js";
// 1.统计
export function statistics(data){
	return request.get('wx/chat/statistics',data)
}

// 2.全部未读消息数量
export function allNoReadNum(data){
	return request.get('wx/chat/no/read/number',data)
}

// 3.会话列表
export function chatList(data){
	return request.get('wx/chat/list',data,)
}

// 4.聊天记录
export function recordList(doctorId,patientId,data){
	return request.get(`wx/chat/record/list/${doctorId}/${patientId}`,data)
}

/**
 * .查询最新聊天记录
 *
*/
export function newChat(doctorId,patientId,data){
  return request.get(`wx/chat/list/new/${patientId}/${doctorId}`,data);
}


// 5.发送消息
export function chatSend(data){
	return request.post('wx/chat/send',data)
}
// 6.查看患者图文咨询详情
export function consultationDetail(consultId){
	return request.get('wx/chat/graphic/consultation/detail/'+consultId)
}
// 7.退诊

export function Withdrawal(id){
	return request.post('foregin/order/withdrawal',id)
}
// 8.查看患者处方
export function patientDetail(prescriptionId){
	return request.get(`wx/chat/prescription/patient/detail/${prescriptionId}`)
}
/**
 *5.更新聊天记录为已读
 *
*/
export function updateReadStatus(data){
  return request.post('wx/chat/update/read/status',data);
}

/**
 *根据医生和就诊人获得会话信息 ---激活状态
 *
*/
export function getSessionInfo(doctorId,patientId){
  return request.get(`wx/chat/is/activation/${doctorId}/${patientId}`);
}
// 3、查询用户协议
export function getUserAgreement(data){
	return request.post('app/agreement/getByTypeAndDelFlag',data,{
		noAuth: true,
		noVerify: true
	})
}
